package day09.Ti.HashMapDome;

import java.util.LinkedHashMap;
import java.util.Scanner;

public class Ti02 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        LinkedHashMap<Character, Integer> lhm = new LinkedHashMap<>();
        System.out.println("请输入一个字符串");
        String s = sc.nextLine();
        char[] c = s.toCharArray();
        for (char ch : c) {
            if (!lhm.containsKey(ch)){
                lhm.put(ch,1);
            }else {
                int count=lhm.get(ch)+1;
                lhm.put(ch,count);
            }
        }
        System.out.println(lhm);
    }
}
